package com.imy.lua.code;

public class ImageCodeMaker {

    public static String getFindImageCode(String fileName) {
        if (!fileName.endsWith(".png")
                && fileName.endsWith(".jpg")) {
            fileName = fileName + ".png";
        }
        String code = "local res= Screen:capture();\n" +
                "    local point = Image:findImage(res, \"/res/" + fileName + "\")\n" +
                "    if point~=nil then\n" +
                "    -- app:toast(\"找到了\")\n" +
                "    end";
        return code;
    }
}
